//
//  JQFYUserJoinInChatGroupModel.m
//  JQFY
//
//  Created by 代辉 on 2017/10/24.
//  Copyright © 2017年 yannis. All rights reserved.
//

#import "JQFYUserJoinInChatGroupModel.h"

@implementation JQFYUserJoinInChatGroupModel

- (void)getChatGroupSuccess:(void (^)(NSArray *))success
{
    NSDictionary *parameters = @{ @"token":@"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOi8vYXBwLnVuaW5oaWJpdGVkLmNuL2FwaS91c2VyL21hbmFnZSIsImlhdCI6MTUwODgzNDEyMCwiZXhwIjoxNTExNDI2MTIwLCJuYmYiOjE1MDg4MzQxMjAsImp0aSI6ImlVTWN5enN2OXlycEN0elAiLCJzdWIiOjEwMDAyMiwicHJ2IjoiODdlMGFmMWVmOWZkMTU4MTJmZGVjOTcxNTNhMTRlMGIwNDc1NDZhYSJ9.T7W_D2xRdWkp2lvwlmXyJM3OdeIbqPQyIPYlP5y4gBI",//[JQFYUserData userDataInSandbox].token,
                                  @"easemob_id":@"18625229133"//[JQFYUserData userDataInSandbox].loginName
                                  };
    
    [[AFHTTPSessionManager manager] POST:@"http:app.uninhibited.cn/api/easemob/user/group/list"
                              parameters:parameters
                                progress:nil
                                 success:^(NSURLSessionDataTask * _Nonnull task, id  _Nullable responseObject) {
                                     
                                     if ([responseObject[@"status"] isEqualToString:@"success"]) {
                                         success([NSArray yy_modelArrayWithClass:[self class] json:responseObject[@"msg"]]);
                                     }
                                     
                                 } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
                                     NSLog(@"error:%@",error);
                                 }];
}
@end
